# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: Danct12 <danct12@disroot.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=squeekboard
pkgver=1.9.2
pkgrel=1
pkgdesc="The final Phosh keyboard"
arch="all !s390x !ppc64le !mips !mips64" # Blocked by rust, fails to build on ppc64le
url="https://source.puri.sm/Librem5/squeekboard"
license="GPL-3.0-or-later"
makedepends="meson ninja rust cargo bash glib-dev wayland-protocols wayland-dev
	gtk+3.0-dev libcroco-dev gnome-desktop-dev"
checkdepends="xvfb-run"
source="https://source.puri.sm/Librem5/squeekboard/-/archive/v$pkgver/squeekboard-v$pkgver.tar.gz
	terminal.yaml"
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare

	# A better terminal layout
	# Upstream PR: https://source.puri.sm/Librem5/squeekboard/-/merge_requests/345
	cp "$srcdir"/terminal.yaml "$builddir"/data/keyboards/terminal.yaml
}

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	xvfb-run ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}
sha512sums="609fbbbc888b35ce0b6cba114fb7f85e00bdaf6899afc7fb9fcfd87900985b67f5c646b55fb8e760543e0f9be7d1bc2d243536d498e5e22f99d8bcebd236f2fd  squeekboard-v1.9.2.tar.gz
1799ec16f020f3ad544e679ebf75a8b9c8ecfe64a5fab7731a76f8a1d0c37fbcb4a061571f6ef30dbddbec19eaef5d79c5665acd903a5b1ee2a889143b9d9f02  terminal.yaml"
